Skip to content

Return the pk/id for docs in search #6544

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 18, 2025

Conversation

smithellis
Copy link
Contributor

This resolves the issue where related documents could not be added when editing document metadata.

The search was not returning a pk/id, thus the JS could not assign the pk to a returned result, rendering the JS helpless to receive click event data.

We should consider converting this to TomSelect or otherwise improving the UI/UX.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This PR adds the primary key (id) into the search result JSON to allow the UI to correctly retrieve and handle click event data for document metadata editing.

  • Added the "id" field to the result dictionary in the make_result function.
  • Addresses the issue where search results did not include a unique identifier for related documents.

Reviewed Changes

File Description
kitsune/search/search.py Added "id" field to include the primary key

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

@akatsoulas akatsoulas merged commit 64a23aa into mozilla:main Mar 18, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants